module test_base_mod

use pFUnit

implicit none

!> Overload the pFUnit run/summary with a formatted output
interface Run
    module procedure Run_Formatted
end interface

contains

subroutine Run_Formatted(name, suite, result)
    character(len=*),      intent(in) :: name
    type(TestSuite_type),  intent(in) :: suite
    type(TestResult_type), intent(in) :: result
    character(len=100) :: summary_statement
    write(6,'("Testing ",a)',advance='no') trim(name)
    call run( suite, result )
    summary_statement = summary ( result )
    write(6,'(x,a)') trim( summary_statement )
end subroutine Run_Formatted

end module test_base_mod
